module CartsHelper

  # Selecteer hoeveelheid voor winkelwagentje
  def select_product_quantiy(cart, item)

    if item.quantity < 10
      options = (1...20).to_a
    else
      options = (item.quantity-10...item.quantity+10).to_a
    end

    form_tag cart_product_path(item.product), :method => :put do
      concat select_tag(:quantity, options_for_select(options, item.quantity), {:class => 'cart-quantity-select'} )
      concat submit_tag('Verander aantal', {:class => 'cart-quantity-submit'})
    end


    return nil
  end
end
